﻿<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">

    <title>${setting.siteName} - 订单管理列表</title>
    <meta name="keywords" content="${setting.siteName}">
    <meta name="description" content="${setting.siteName}">

    <!-- BEGIN HEADER -->
    [#include "/admin/include/style.ftl"]
    <!-- END HEADER -->
    <style type="text/css">
        .btn {
            margin: 0 5px;
        }

        .file_upload_box {
            display: inline-block;
            width: 100px;
            position: relative;
            overflow: hidden;
            margin-left: 10px;
            border-radius: 5%;
        }

        .file_upload_box input[type=file] {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            line-height: 32px;
            opacity: 0;
            cursor: pointer;

        }

        .file_upload_box a {
            display: inline-block;
            width: 100%;
            line-height: 30px;
            text-align: center;
            font-family: "Microsoft Yahei";
            background-color: #1ab394;
            color: #FFF;
            /*font-weight: 700;*/
            text-decoration: none;

        }
    </style>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content  animated fadeInRight">

    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <form id="listForm" action="list.jhtml" method="get">
                    <div class="ibox-title">
                        <h5>订单管理列表 </h5>
                        [#--                        <div class="ibox-tools">--]
                        [#--                            <a class="btn btn-outline btn-danger btn-xs btn-delete-loippi-group"><i--]
                        [#--                                        class="fa fa-trash"></i> 删除</a>--]
                        [#--                        </div>--]
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <div class="form-group">
                                <input type="text" id="keyword" name="keyword"
                                       class="form-control-static col-sm-6 offset2" placeholder="请输入用户昵称，收件人姓名、手机搜索">
                                [#--                                <select class="form-search col-sm-2" id="selectstatus" name="statusKey">--]
                                [#--                                    <option value="">请选择状态</option>--]
                                [#--                                    <option value=1>待支付</option>--]
                                [#--                                    <option value=2>已支付/待发货</option>--]
                                [#--                                    <option value=3>已发货/待收货</option>--]
                                [#--                                    <option value=4>已收货/待评价</option>--]
                                [#--                                </select>--]
                                <button type="submit" class="btn btn-sm btn-primary loippi-search-button col-sm-1"> 搜索
                                </button>
                                <button type="reset" class="btn btn-sm btn-info col-sm-1">重置</button>
                                <div class="file_upload_box">
                                    <a href="${base}/admin/order/outputExcel.jhtml" id="downloadFile">导出Excel</a>
                                </div>
                            </div>
                        </div>
                        <div class="dataTables_wrapper form-inline">
                            <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
                                <thead>
                                <tr>
                                    <th><input type="checkbox" class="i-checks" name="checkAll"></th>
                                    <th>订单号</th>
                                    <th>用户昵称</th>
                                    <th>商品名称</th>
                                    <th>订单总额</th>
                                    <th>收货人姓名</th>
                                    <th>收货手机号</th>
                                    <th>收货地址</th>
                                    <th>订单类型</th>
                                    <th>订单状态</th>
                                    <th>下单时间</th>
                                    <th>快递单号</th>
                                    <th>物流公司名称</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                [#list page.content as tOrder]
                                    <tr>
                                        <td>
                                            <input type="checkbox" class="i-checks" name="ids" value="${tOrder.id}">
                                        </td>
                                        <td>${(tOrder.orderSn)!''}</td>
                                        <td>${(tOrder.user.nickName)!''}</td>
                                        [#assign medicineNames=""/]
                                        [#list tOrder.items as oItem]
                                            [#assign medicineNames+=oItem.medicineName+","/]
                                        [/#list]
                                        <td>${medicineNames}</td>
                                        <td>${(tOrder.amount)!''}</td>
                                        <td>${(tOrder.userName)!''}</td>
                                        <td>${(tOrder.phone)!''}</td>
                                        <td>${(tOrder.addressDetail)!''}</td>
                                        <td>${(((tOrder.orderType)!'')==0)?string('普通', '特殊')}</td>
                                        <td> [#switch tOrder.orderStatus]
                                                [#case 1]
                                                    已支付
                                                    [#break]
                                                [#case 2]
                                                    待发货
                                                    [#break]
                                                [#case 3]
                                                    已发货
                                                    [#break]
                                                [#case 4]
                                                    已送达
                                                    [#break]
                                                [#case 7]
                                                    已签收
                                                    [#break]
                                                [#case 0]
                                                    待支付
                                                    [#break]
                                                [#case -1]
                                                    已取消
                                                    [#break]
                                            [/#switch]</td>
                                        <td>${(tOrder.orderTime?string('yyyy-MM-dd'))!''}</td>
                                        <td>${(tOrder.logisticsNumber)!''}</td>
                                        <td>
                                            [#switch tOrder.logisticsCompany]
                                                [#case "zhongtong"]
                                                    中通快递
                                                    [#break]
                                                [#case "shunfeng"]
                                                    顺风速运
                                                    [#break]
                                                [#case "yunda"]
                                                    韵达快递
                                                    [#break]
                                                [#case "shentong"]
                                                    申通快递
                                                    [#break]
                                                [#case "yuantong"]
                                                    圆通速递
                                                    [#break]
                                                [#case "huitongkuaidi"]
                                                    百世快递
                                                    [#break]
                                                [#case "debangkuaidi"]
                                                    德邦快递
                                                    [#break]
                                                [#case "youzhengguonei"]
                                                    邮政快递包裹
                                                    [#break]
                                                [#case "tiantian"]
                                                    天天快递
                                                    [#break]
                                            [/#switch]
                                        <td>
                                            <a href="${base}/admin/order/view/${tOrder.id}.jhtml"
                                               class="btn btn-xs btn-default"> ${message("admin.common.view")} </a>

                                            [#--                                            <a class="btn btn-info btn-xs btn-edit-loippi" data-id="${tOrder.id}"--]
                                            [#--                                               href="edit/${tOrder.id}.jhtml"><i--]
                                            [#--                                                        class="fa fa-paste"></i> ${message("admin.common.edit")} </a>--]

                                            <a href="${base}/admin/order/edit/${tOrder.id}.jhtml"
                                               class="btn btn-warning btn-xs btn-edit-loippi" data-id="${tOrder.id}"><i
                                                        class="fa fa-edit"></i>录入快递信息</a>
                                        </td>
                                    </tr>
                                [/#list]
                                </tbody>
                            </table>
                            [@pagination pageNumber = page.pageNumber totalPages = page.totalPages]
                                [#include "/admin/include/pagination.ftl"]
                            [/@pagination]
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<!-- BEGIN Script -->
[#include "/admin/include/script.ftl"]
<!-- END Script -->

<script>

    $(document).ready(function () {
        [@flash_message /]
    });
</script>
</body>

</html>
